<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Employee.Master" Inherits="System.Web.Mvc.ViewPage<IndexViewModel>" %>
<%@ Import Namespace="System.Globalization"%>
<%@ Import Namespace="Website.Models.UserAdministration"%>
<%@ Import Namespace="PagedList"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	User Administration
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

	<link href='<% =Url.Content("~/Content/MvcMembership/MvcMembership.css") %>' rel="stylesheet" type="text/css" />

    <h2>User Administration</h2>
 <h3>Roles</h3>
    <div class="mvcMembership-allUsers">
    <% if(Model.Roles.Count() > 0){ %>
	<ul class="roles">
    <table class="staffingexpert" style="width: 650px" cellspacing="0" id="Table1">
        <thead>
        <tr>
            <th>Role</th>
            <th>Action</th>
       </tr>
       </thead>
       <tbody>
       <% foreach(var role in Model.Roles){ %>
             <tr>
       
                <td style="width: 250px" align="center"><% =Html.ActionLink(role, "Role", new{id = role}) %></td>
                <td style="width: 250px" align="center"><% using(Html.BeginForm("DeleteRole", "UserAdministration", new{id=role})){ %>
				<input type="submit" value="Delete" />
				<% } %></td>
				
            </tr>     
			<% } %>
	<% }else{ %>
		<p>No roles have been created.</p>
	<% } %>
	</tbody>
	</div>
	<div>
	<% using(Html.BeginForm("CreateRole", "UserAdministration")){ %>
		<fieldset>
			<label for="id">Role:</label>
			<% =Html.TextBox("id") %>
			<input type="submit" value="Create Role" />
		</fieldset>
	<% } %>
	</div>  
</asp:Content>